﻿using System;
using System.IO;

namespace DocumentIo
{
    class Program
    {
        static void Main(string[] args)
        {
            if (Directory.Exists("mySolo"))
            {
                Console.WriteLine("存在文件");
            }
            else
            {
                DirectoryInfo directoryInfo = new DirectoryInfo("C:\\mySolo");
                directoryInfo.Create();
               
            }

           
            FileStream file = new FileStream("C:\\mySolo\\test.txt",FileMode.OpenOrCreate,FileAccess.ReadWrite);
            
            StreamWriter sw = new StreamWriter(file);
            sw.WriteLine("荷塘月色，桥边姑娘，听海哭的声音");
            sw.Close();
        }
    }
}
